<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.jieSuan.zhongXing"/><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.zhangHuChaKan"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.zhangHuChaKan"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.zhangHuGuanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.zhangHuGuanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.zhangHuChaKan"/></a></li>
        </ol>
     </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                	<div class="textalign1"><spring:message code="message.jieSuan.jiGouMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                        <div class="boxinput">
                        <input type="text" class="textinput"  id="orgName"  name="orgName" placeholder="<spring:message code="message.jieSuan.jiGouMingCheng"/>" />
                  		</div>
        			<div class="textalign1"><spring:message code="message.jieSuan.jiGouBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                        <div class="boxinput">
                        <input type="text" class="textinput"  id="orgCode" name="orgCode" placeholder="<spring:message code="message.jieSuan.jiGouBianMa"/>" />
                   		</div>
                    <div class="textalign1"><spring:message code="message.listForm.YiLiaoJiGouDiQu"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput" style="margin-top: -6px">
                       <table style="width:100%;">
                           <tr>
                              <td style="width:33%">
                                <select class="textinput" id="areaId" name="areaId" disabled="disabled"><option value="${area.areaId}">${area.areaName}</option></select>
                              </td>
                              <td style="width:33%">   
                                <select class="textinput" id="area1" name="area1" ></select>
                                </td>
                              <td style="width:33%">
                                <select class="textinput" id="area2" name="area2" ></select>
                              </td>
                           </tr> 
                        </table>     
                    </div>
                 	<div class="textalign1" >
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm" id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <form action="${ctx}/acctInfoCenter/toCenterHospSeeBank.html" method="post" id="BankForm">
            <input type="hidden" id="orgId" name="orgId">
        </form>
        
        <form action="${ctx}/acctInfoCenter/toCenterHospSeeTrans.html" method="post" id="BankAcctForm">
            <input type="hidden" id="BankOrgId" name="orgId">
        </form>
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
 //绑定回车
   $('#orgCode,#orgName,#areaId,#area1,#area2').bind('keydown', function(event) {
       if (event.keyCode == "13") {
           $('#selectDicCompType').click();
       }
   });	
   $("#orgName").focus();//加载页面光标在第一个查询框内
   
   
        $(function() {
            $("#gridlist").jqGrid(
                    {   url : "getCenterHospSee.html",
                        mtype : "POST",
                        datatype : "json",
                        autowidth : true,
                        height : 349,
                        colNames : [ '<spring:message code="message.jqGrid.cz"/> ',
                                     '<spring:message code="message.jieSuan.zhangHu"/>id',
                                     '<spring:message code="message.jieSuan.jiGouBianMa"/>',
                                     '<spring:message code="message.jieSuan.jiGouMingCheng"/> ',
                                     '<spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.diQu"/>',
                                     '<spring:message code="message.jieSuan.yuE"/> ',
                                     '<spring:message code="message.jieSuan.keYongYuE"/>',
                                     '<spring:message code="message.jieSuan.daiJieSuanYuE"/>'
                                     ],
                        colModel : [
                                    {name : 'order',index : 'order',width : 60, sortable:false,align : "center",
                                        formatter:function(val, opts,rowdata) {
                                            var str="<a href='javaScript:bankLook(\""+rowdata.orgId+"\")' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -160px -40px' class='opIcon' title='<spring:message code="message.jieSuan.yinHangZhangHuXinxi"/><spring:message code="message.jieSuan.zhangHuChaKan"/>'></a>"
                                                +"<a href='javaScript:bankAcctLook(\""+rowdata.orgId+"\")' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jieSuan.shouZhiMingXi"/><spring:message code="message.jieSuan.zhangHuChaKan"/>'></a>";
                                            return str
                                        }
                                    },
                                    {name : 'orgId',index : 'orgId',hidden : true , width : 100,align : "center", sortable:false},
                                    {name : 'orgCode',index : 'orgCode',width : 140,align : "center", sortable:false},  
                                    {name : 'orgName',index : 'orgName',width : 140,align : "left",
                                    	formatter:function(cellvalue, options, row){
                                    		 return "<a href=\"javascript:$.HN.dialog.opendialog('"+cellvalue+"','<spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jqGrid.cz.xiangQing"/>','stdHospInfo/hospInfoDetail.html?hospId="+row.orgId+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>";
                                    	}
                                    }, 
                                    {name : 'areaName',index : 'areaName',width : 100,align : "center", sortable:false},
                                    {name : 'outstandAmtStr',index : 'outstandAmtStr',width : 100,align : "right", sortable:false,
                                    	formatter:function(val, opts,rowdata){
                                    		return formatAmount(val, opts,rowdata);
                                    	}
                                    },
                                    {name : 'availableAmtStr',index : 'availableAmtStr',width : 100,align : "right",summaryType : 'sum', sortable:false,
                                    	formatter:function(val, opts,rowdata){
                                    		return formatAmount(val, opts,rowdata);
                                    	}
                                    },
                                    {name : 'pendingAmtStr',index : 'pendingAmtStr',width : 100,align : "right", sortable:false,
                                    	formatter:function(val, opts,rowdata){
                                    		return formatAmount(val, opts,rowdata);
                                    	}
                                    }
                                   
                        ],
                        rowNum : 20,
                        rowList : [ 10, 20, 50,100],
                        rownumbers : true,
                        pager : "#gridpage",
                        //multiselect: true, 
                        viewrecords : true,
                        gridComplete: function(){
				        	 //序号列宽度自适应（参数为jqgridID）
				               autoRNWidth("gridlist");
				           	//数据只有一条时默认选中（参数为jqgridID）
				               selectByOneData("gridlist");
						},
                        caption : "<spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.zhangHuLieBiao"/>",
                        jsonReader : {
                            repeatitems : false,
                            id : "ids"
                        }
                    });
        	$("#area1").HNSelect({
                url: "${ctx}/selectController/getArea.html", 
                data: { ID: '${sysAreaId}' }, 
                defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
                defaultselect: "",
                func: function () {
                    $("#area2").HNSelect({
                        parent_selector: "#area1", 
                        url: "${ctx}/selectController/getArea.html", 
                        dataid: "ID", 
                        defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
                        defaultselect: ""
                    });
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
            $(window).trigger("resize");
        });
               function getFoucs(obj, rowId) {
                   var text = $.trim($(obj).val());
                   if (text != null && text != "") {
                       var $checkbox = $("#jqg_gridlist_" + rowId);
                       if ($checkbox.is(":not(:checked)")) {
                           $("#gridlist").setSelection(rowId);
                       }
                   }
               }
               
               //查询
               function gridSerch() {
                   var orgCode = $.trim($("#orgCode").val());
                   var orgName = $.trim($("#orgName").val());
                   var area1 =  $.trim($("#area1").val());
                   var area2 =  $.trim($("#area2").val());
                   $("#gridlist").jqGrid('setGridParam',{  
                       datatype:'json',
                       postData:{
                    	   "area1":area1,
                    	   "area2":area2,
                           "orgCode":orgCode,
                           "orgName":orgName
                       },
                       page:1
                   }).trigger("reloadGrid"); //重新载入  
               }
               
               //查看银行账户信息
                 function bankLook(id) {
                   $("#orgId").val(id);
                   $("#BankForm").submit();
                 }
                    
               
               //查看交易明细
               function bankAcctLook(id){
                   $("#BankOrgId").val(id);
                   $("#BankAcctForm").submit();
               }
    </script>
</body>
</html>